<?php 
if ($result_new) {
    ?>
<div  class="anhvui">
        <div class="toph"> ẢNH VUI </div>
        <div id="anhvui">
              <ul>
       <?php
$arrFun = array_chunk($result_new, 4);       
       foreach ($arrFun as $arr) {
     ?>          
            <li>
            <?php 
            foreach ($arr as $row) {
                $url = url($row->calias.'/chi-tiet/'.$row->alias);
                $image = iUrlFileThumb($row->image);
                $title = $row->title;
             ?>
                  <div class="anhvui_content">
                <div class="img"> 
                <a href="<?php echo $url ?>">
                <img src="<?php echo $image ?>" alt="<?php echo $title ?>" title="<?php echo $title ?>" /> 
                </a>
                </div>
                <div class="title"> <a href="<?php echo $url ?>"><?php echo $title ?> </a></div>
              </div>
                  
           <?php 
           }
            ?>       
                  
                </li>
      <?php 
      }
       ?>    
          </ul>
            </div>
      </div>
<?php if (count($result_new) <= 4) { ?>     
<script>
jQuery(document).ready(function() {
    jQuery('#prevBtn').hide();
    jQuery('#nextBtn').hide();
})
</script> 
<?php } ?>     
<?php 
}
 ?>    
  